Circular buffers are one data structure for storing information in computer systems. Conceptually a circular buffer is shown in FIG. 1. FIG. 1 is a drawing conceptually showing a circular buffer according to the prior art. A circular buffer 100 includes memory elements 102, 104, 106, 108, 110, 112, and 114 organized in a circular fashion. When writing data to the circular buffer 100, a processor may write information first to memory element 102, then element 104, then element 106, then element 108, then element 110, then element 112, then element 114, and then continue around the circle again as more data is written into the buffer 100. In this sense, the circular buffer provides an endless buffer, in that new data can continue to be written into the buffer 100 regardless of whether there are any available memory elements. If a memory element has not yet been accessed to retrieve information stored in the memory element, then the old data of that memory element is written over with new data. Circular buffers may be well suited for implementing first-in-first-out (FIFO) buffers, in which the oldest data in a buffer should be the next data read out of the buffer. A conventional implementation of a circular buffer is a buffer in a keyboard for recording keystrokes. Another conventional implementation of a circular buffer is for performing filtering operations on data.
Although conceptually the circular buffer is circular in operation, computer memory devices are linearly-accessed devices. Computer memory is addressed in a linear manner with addresses starting at zero and increasing up to the memory size. An implementation of a circular buffer in linear memory is shown in FIG. 2. FIG. 2 is a drawing showing a circular buffer implemented in linear memory according to the prior art. A linear memory 200 includes the memory elements 102, 104, 106, 108, 110, 112, and 114. Conceptually, a processor can move from element 102 to 104 through a simple step, and likewise for each of the other steps through the circular buffer 100, including from element 114 back to 102. However, as shown in the circular buffer 200 of FIG. 2, the step from memory element 114 to memory element 102 is not a simple step but a jump through the linear memory 200. As operations progress through the circular buffer 200, calculating the current and next address can be difficult. For example, moving from memory element 106 to 108 may be as simple as adding a fixed amount to the memory address for memory element 106. However, moving from memory element 114 to 102 require more complicated math that can slow down access to the circular buffer 200 and increase difficulty for a programmer writing an application using the circular buffer 200 to store data.
Shortcomings mentioned here are only representative and are included simply to highlight that a need exists for improved electrical components, particularly for processors employed in consumer-level devices, such as mobile phones. Embodiments described herein address certain shortcomings but not necessarily each and every one described here or known in the art.